package com.example.origin.finance.enums;

import com.example.origin.finance.dto.*;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum TableNameEnum {

    XUEQIU_GUPIAO_INDICATOR("xueqiu_gupiao_indicator",4, XueqiuIndicator.class,2),
    XUEQIU_GUPIAO_QUOTE("xueqiu_gupiao_quote",1, XueqiuQuote.class,1),
    CNINFO_GUPIAO_REPORT("cninfo_gupiao_report",4, CnInfoReport.class,3),
    XUEQIU_GUPIAO_CASH_FLOW("xueqiu_gupiao_cash_flow",4, XueqiuCashFlow.class,4),
    XUEQIU_GUPIAO_KLINE("xueqiu_gupiao_kline",20, XueqiuKline.class,5),
    XUEQIU_GUPIAO_KLINE_US("xueqiu_gupiao_kline_us",20, XueqiuKline.class,7),
    XUEQIU_GUPIAO_QUOTE_US("xueqiu_gupiao_quote_us",1, XueqiuQuote.class,6),
    XUEQIU_JIJIN_KLINE_US("xueqiu_jijin_kline_us",1, XueqiuKline.class,9),
    XUEQIU_JIJIN_QUOTE_US("xueqiu_jijin_quote_us",1, XueqiuQuote.class,8),
    ;

    private String table;
    private Integer count;
    private Class clazz;
    private Integer num;

    public static TableNameEnum get(int num){
        for (TableNameEnum value : values()) {
            if (value.getNum().equals(num)) {
                return value;
            }
        }
        return null;
    }
}
